-
Notifications
You must be signed in to change notification settings - Fork 29.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[prop-types] add elementType and resetWarningCache #33244
[prop-types] add elementType and resetWarningCache #33244
Conversation
I did look into the diff --git a/types/react-jss/react-jss-tests.tsx b/types/react-jss/react-jss-tests.tsx
index 5fe76ae1..cfcad4cd 100644
--- a/types/react-jss/react-jss-tests.tsx
+++ b/types/react-jss/react-jss-tests.tsx
@@ -27,9 +27,9 @@ interface ButtonProps {
active?: boolean;
}
-const styles = (theme: MyTheme) => createStyles({
+const styles = (theme: MyTheme) => createStyles<ButtonProps>({
myButton: {
- color: (props: ButtonProps) => props.active ? 'red' : theme.color.primary,
+ color: props => props.active ? 'red' : theme.color.primary,
margin: 1,
"& span": {
fontWeight: "revert" |
@eps1lon Thank you for submitting this PR! 🔔 @DovydasNavickas @ferdaber - please review this PR in the next few days. Be sure to explicitly select If no reviewer appears after a week, a DefinitelyTyped maintainer will review the PR instead. |
@eps1lon The Travis CI build failed! Please review the logs for more information. Once you've pushed the fixes, the build will automatically re-run. Thanks! |
Can you add a test for the exotic components like |
@ferdaber How would this look like? As far as I know I can't expect a specific type in the typescript interface and then validate a less specific type in |
I meant a test that those components, when passed in as props, passes the They're tightly coupled so changes to this package almost necessarily needs a retest of the |
@ferdaber the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't want this change to be blocked because of tests so I'll go ahead and approve.
7ea02ff
to
cb1912d
Compare
A definition owner has approved this PR ⭐️. A maintainer will merge this PR shortly. If it shouldn't be merged yet, please leave a comment saying so and we'll wait. Thank you for your contribution to DefinitelyTyped! |
I just published |
Please fill in this template.
npm test
.)npm run lint package-name
(ortsc
if notslint.json
is present).If changing an existing definition:
optionalElement
) added with Add a PropTypes for React elementType (ie. MyComponent) facebook/prop-types#211tslint.json
containing{ "extends": "dtslint/dt.json" }
.